package com.zhuxiaomei.mapper;

import com.zhuxiaomei.annotation.AutoFill;
import com.zhuxiaomei.entity.user.Couple;
import com.zhuxiaomei.enumeration.OperationType;
import com.zhuxiaomei.vo.user.CoupleInfoVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.web.bind.annotation.PathVariable;
import tk.mybatis.mapper.common.Mapper;

/**
 * @author hxm
 * @date 2024/12/20 15:36
 * @description
 */
public interface CoupleMapper extends Mapper<Couple> {

    @Select("select * from couples where man_id = #{userId} or woman_id = #{userId}")
    Couple selectByManOrWomanID(@PathVariable("userId") Long userId);

    @AutoFill(OperationType.INSERT)
    void insertCouple(Couple couple);

    @AutoFill(OperationType.UPDATE)
    Integer updateCoupleByManOrWomanId(@Param("couple") Couple couple, @Param("currentId") Long currentId);
}
